package com.hzit.proxy.menu;

import com.hzit.net.util.WXNetUtil;
import com.hzit.proxy.base.AccessToken;

public class MenuProxy {

        public static void main(String[] args) {

            String menu = "{\n" +
                    "  \"button\": [\n" +
                    "    {\n" +
                    "      \"name\": \"扫码\",\n" +
                    "      \"sub_button\": [\n" +
                    "        {\n" +
                    "          \"type\": \"scancode_waitmsg\",\n" +
                    "          \"name\": \"扫码带提示\",\n" +
                    "          \"key\": \"rselfmenu_0_0\",\n" +
                    "          \"sub_button\": []\n" +
                    "        },\n" +
                    "        {\n" +
                    "          \"type\": \"scancode_push\",\n" +
                    "          \"name\": \"扫码推事件\",\n" +
                    "          \"key\": \"rselfmenu_0_1\",\n" +
                    "          \"sub_button\": []\n" +
                    "        },\n" +
                    "        {\n" +
                    "          \"type\": \"view\",\n" +
                    "          \"name\": \"微信API\",\n" +
                    "          \"url\": \"https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html\"\n" +
                    "        }\n" +
                    "      ]\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"name\": \"发图\",\n" +
                    "      \"sub_button\": [\n" +
                    "        {\n" +
                    "          \"type\": \"pic_sysphoto\",\n" +
                    "          \"name\": \"系统拍照发图\",\n" +
                    "          \"key\": \"rselfmenu_1_0\",\n" +
                    "          \"sub_button\": []\n" +
                    "        },\n" +
                    "        {\n" +
                    "          \"type\": \"pic_photo_or_album\",\n" +
                    "          \"name\": \"拍照或者相册发图\",\n" +
                    "          \"key\": \"rselfmenu_1_1\",\n" +
                    "          \"sub_button\": []\n" +
                    "        },\n" +
                    "        {\n" +
                    "          \"type\": \"pic_weixin\",\n" +
                    "          \"name\": \"微信相册发图\",\n" +
                    "          \"key\": \"rselfmenu_1_2\",\n" +
                    "          \"sub_button\": []\n" +
                    "        },\n" +
                    "        {\n" +
                    "          \"name\": \"发送位置\",\n" +
                    "          \"type\": \"location_select\",\n" +
                    "          \"key\": \"rselfmenu_2_0\"\n" +
                    "        }\n" +
                    "      ]\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"name\": \"小游戏\",\n" +
                    "      \"sub_button\": [\n" +
                    "        {\n" +
                    "          \"type\": \"click\",\n" +
                    "          \"name\": \"石头\",\n" +
                    "          \"key\": \"石头\"\n" +
                    "        },\n" +
                    "        {\n" +
                    "          \"type\": \"click\",\n" +
                    "          \"name\": \"剪刀\",\n" +
                    "          \"key\": \"剪刀\"\n" +
                    "        },\n" +
                    "        {\n" +
                    "          \"type\": \"click\",\n" +
                    "          \"name\": \"布\",\n" +
                    "          \"key\": \"布\"\n" +
                    "        }\n" +
                    "      ]\n" +
                    "    }\n" +
                    "  ]\n" +
                    "}";


            String url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + AccessToken.getToken();

            String result = WXNetUtil.post(url, menu);

            System.out.println(result);

        }

    }


